Fixed crash with image loading