Fixed crash when image is nil