Fix problem when compress images