Extended fix of small images from facebook

Still needs testing, as it may be fragile when working on some exotic things, not taken into consideration while writing this piece of code