Fixed issues with image detection and rendering