Fixing 500 error when no image exists