Image Resize Middleware for Slim Framework