This post should give you almost everything you need: https://devcentral.f5.com/community/group/aft/2165545/asg/50
However, you'll need to add some logic to ensure requests you don't want handled by this are just passed along. I'd suggest you add some unique path for the images in the index.html file that the 'normal' application would never use, for example: /404/404/image1.jpg. Then you can just do an if [HTTP::uri]] starts_with "/404/404" in a HTTP_REQUEST event; if it matches, you'll serve the iFile, if not things just work as normal.