Fixed the image bug

I believe the bug has been fixed, though I'll look back later and try to
see if I can come up with a cleaner solution.