Fixes image preview resizing