More jQuery and additional image loading checks for non-image-only content

Otherwise the popup-size might be wrong.