Improved plugin to be able to work with directory of images