In case of malicious users double check paths, so that they are not able to traverse outside of the image directory.