Fix bugs with y mouse coordinates on rectangular images