clean up duplicated code
changed filters when inserting a post in an image, now the adaptive code is inserted #5, #10
add some logic to the scripts.js algorithm for selecting an image size #5