fixed a bug when image wasnt drawn properly if height was too small