fixing handling square images