Added proper image logic