fixed images being drawn wrongly