You shouldn't get a flash of the image using the JavaScript solution (the two suggestions were not intended to be used together) but, agreed, it's not the most elegant solution.
Here's a slightly better JavaScript version which minimizes the delay by looking out for the 'jb-dialog-login-form' container to appear in the DOM and applying the background-image to it as soon as it is ready. (It relies on your gallery container being named 'juicebox-container' but you can change this if you like.)
<script type="text/javascript">
$(document).ready(function() {
var flag1 = false, flag2 = false;
var observer = new MutationObserver(function(mutations, instance) {
if (!flag1 && $('.jb-flag-fullscreen').length) {
$('html').css('height', '100%');
flag1 = true;
}
if (!flag2 && $('#jb-dialog-login-form').length) {
$('#jb-dialog-login-form').css('background', 'initial');
$('#jb-dialog-login-form').parent().css('background-image', 'url("images/background.jpg")');
flag2 = true;
}
if (flag1 && flag2) {
instance.disconnect();
}
});
var juicebox = document.getElementById('juicebox-container');
observer.observe(juicebox, {
childList: true,
subtree: true
});
});
</script>
Perhaps you'd like to suggest this as an idea for a future version in the Feature Requests forum thread.
This keeps all the ideas together and ensures that they are not overlooked by the developers.
I do not know the likelihood of any suggestions being implemented but this is certainly the best place for all ideas.
Thank you.