Handle webkit image resize behaviour correctly